package com.nf.action;

import com.opensymphony.xwork2.ActionSupport;

public class User extends ActionSupport {
    private String userName;
    private String userPassword;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    //用于处理登录信息，判断成功或者失败
    public String login(){
        System.out.println("用户名："+userName);

        if ("admin".equals(userName)&&"123456".equals(userPassword)){
            return this.SUCCESS;
        }else {
            return this.ERROR;
        }

    }
    //用于跳转到登录页面
    public String loginView(){
        return  this.SUCCESS;
    }
}
